package cn.jiyun.controller;

import cn.jiyun.dto.CourseDTO;
import cn.jiyun.feign.CourseFeign;
import cn.jiyun.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 季乾帅
 * @create 2023/8/25 14:08
 */
@RestController
@RequestMapping("/course")
public class CourseController {

    @Autowired
    private CourseFeign courseFeign;

    @RequestMapping("/findKec")
    public Result findKec() {
        return courseFeign.findKec();
    }

    @PostMapping("/findKecPage")
    public Result findKecPage(String tid, @RequestBody CourseDTO courseDTO) {
        return courseFeign.findKecPage(tid, courseDTO);
    }

    @GetMapping("/findPageType")
    public Result findPageType(Integer cid) {
        return courseFeign.findPageType(cid);
    }

    @PostMapping("/findZuixin")
    public Result findZuixin(@RequestBody CourseDTO courseDTO) {
        return courseFeign.findZuixin(courseDTO);
    }

    @PostMapping("/zuixin")
    public Result zuixin(@RequestBody CourseDTO courseDTO) {
        return courseFeign.zuix(courseDTO);
    }
    @PostMapping("/findMyCourse")
    public Result findMyCourse(@RequestParam(value = "userId") String userId, @RequestBody CourseDTO dto){
        return courseFeign.findMyCourse(userId,dto);
    }

}
